import request from '@/utils/request'

// 获取企业列表
export function getList(query) {
    return request({
        url: `/enterprise/getList`,
        method: 'get',
        params: query
    })    
}
// 条件查询
export function getListByParams(data) {
    return request({
        url: `/enterprise/getListByParams`,
        method: 'post',
        data
    })    
}

//获取企业自己的信息
export function getOwnInfo(userId) {
    return request({
      url: `/enterprise/getOwnInfo/${userId}`,
      method: 'get',
    });
}


// 企业新增
export function add(data) {
    return request({
        url: `/enterprise`,
        method: 'post',
        data
    })
}

// 企业修改
export function update(data) {
    return request({
        url: `/enterprise`,
        method: 'put',
        data
    })
}

// 企业删除
export function del(id) {
    return request({
        url: `/enterprise`,
        method: 'delete',
        params: {id} 
    })
}


// 职位新增
export function addJob(data) {
    return request({
        url: `/recruit/insert`,
        method: 'post',
        data
    })
}

// 职位修改
export function updateJob(data) {
    return request({
        url: `/recruit`,
        method: 'put',
        data
    })
}

// 职位删除
export function deleteJob(id) {
    return request({
        url: `/recruit/${id}`,
        method: 'delete',
        params: {id} 
    })
}

